// 配置路由信息
import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

// 导入组件
import Home from '../view/Home'
import Products from '../view/Products'
import About from '../view/About'
import Detail from '../view/Detail'
import productIntro from '../view/ProductIntro'
import Collect from '../view/Collect'
import Cart from '../view/Cart'
import ConfirmOrder from '../view/confirmOrder'
import OrderList from '../view/orderList'

const routes = [
    // {
    //   path: '/',
    //   redirect: '/home'
    // },
    {
        path: '/',
        component: Home
    },
    {
        path: '/products',
        component: Products
    },
    {
        path: '/about',
        component: About
    },
    {
        path: '/detail/:id',
        component: Detail
    },
    {
        path: '/productIntro/:id',
        component: productIntro
    },
    {
        path: '/collect',
        component: Collect
    },
    {
        path: '/cart',
        component: Cart
    },
    {
        path: '/confirmOrder',
        component: ConfirmOrder
    },
    {
        path: '/orderList',
        component: OrderList
    }

];

const router = new VueRouter({
    routes,
    // mode: 'history'
});

export default router
